From: Martin Stjernholm Date: Mon, 10 Feb 2003 00:50:26 +0000 (+0000) Subject: (c-set-offset): Don't find a default syntactic element through X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~28394 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=f4d68e0851f905829724c28a3567b583dd998a09;p=emacs.git (c-set-offset): Don't find a default syntactic element through syntactic analysis if called outside a CC Mode buffer. --- diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 4bd72f29070..c7f1adaa434 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -445,10 +445,11 @@ and exists only for compatibility reasons." ;; initial contents tries to be the last element ;; on the syntactic analysis list for the current ;; line - (let* ((syntax (c-guess-basic-syntax)) - (len (length syntax)) - (ic (format "%s" (car (nth (1- len) syntax))))) - (cons ic 0)) + (and c-buffer-is-cc-mode + (let* ((syntax (c-guess-basic-syntax)) + (len (length syntax)) + (ic (format "%s" (car (nth (1- len) syntax))))) + (cons ic 0))) ))) (offset (c-read-offset langelem))) (list langelem offset current-prefix-arg)))